﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sharp.Domain.PlatformBoundedContext.UserModule.Aggregates;

namespace Sharp.Domain.PlatformBoundedContext.ModelConfigurations
{
    public partial class UserLogConfiguration
        : EntityTypeConfiguration<UserLog>
    {
        public UserLogConfiguration()
        {
            HasKey(x => x.Id);

            Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();

            Property(t => t.UserId)
                .IsRequired();
            Property(t => t.FullName)
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Content)
               .IsMaxLength()
               .IsOptional();
            Property(t => t.Event)
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Eventtime)
                .IsRequired();
            Property(t => t.InternalSources)
                .HasMaxLength(255)
                .IsOptional();
            Property(t => t.ExternalSources)
                .HasMaxLength(255)
                .IsOptional();
        }
    }
}

